<?php
/**
 * 订单业务逻辑处理
 * @access public
 * @copyright www.shopex.cn 2010.12.16
 * @author ome
 */
class omeauto_order_order{
	
	public function create_order_after($sdf){
		//如果有OME自动确认订单插件的话，会按照自动分确认规则来自动确认订单
        /*if($oAuto = kernel::service('do_autoconfirm')){
            if(method_exists($oAuto,'autoconfirm')){
                $oAuto->autoconfirm($order_id);
            }
        }*/
	
		if($sdf['shipping']['is_cod'] == 'true' || $sdf['pay_status'] == '1'){
			if($oAuto = kernel::service('do_autodispatch')){
	            if($sdf['process_status'] != "cancel"){
	                if(method_exists($oAuto,'autodispatch')){
	                    $oAuto->autodispatch($sdf);
	                }
	            }
	        }
		}
	}
	
	public function dispatch_after($order_id){
		if($oAutoconfirm = kernel::service('do_autoconfirm')){
		    if(method_exists($oAutoconfirm,'autoconfirm')){
                $oAutoconfirm->autoconfirm($order_id);
            }
		}
	}
    
}